package cn.edu.scau.cmi.chensicheng.factoryMethodMode;

import cn.edu.scau.cmi.chensicheng.domain.Insurance;
import cn.edu.scau.cmi.chensicheng.factory.BodyInjuryInsuranceFactory;
import cn.edu.scau.cmi.chensicheng.factory.CarInjuryInsuranceFactory;
import cn.edu.scau.cmi.chensicheng.factory.CasualtyInsuranceFactory;
import cn.edu.scau.cmi.chensicheng.factory.MultipleAccidentsInsuranceFactory;

public class InsuranceFactory {
	public static Insurance getInstance(String insuranceTypeString) {
		switch (insuranceTypeString) {
		case "司机受伤":
			return BodyInjuryInsuranceFactory.getInstance();
		case "汽车损坏":
			return CarInjuryInsuranceFactory.getInstance();
		case "人员伤亡":
			return CasualtyInsuranceFactory.getInstance();
		case "多种事故":
			return MultipleAccidentsInsuranceFactory.getInstance();
		default:
			return null;
		}
	}
}
